/**
 * @param {number[]} position
 * @return {number}
 */
export var minCostToMoveChips = function (position) {
  let count1 = 0
  let count2 = 0
  for (let i = 0; i < position.length; i++) {
    if (position[i] % 2) count1++
    else count2++
  }
  return Math.min(count1, count2)
}
